import { createStore } from "vuex";

const store = createStore({
  state: {
    num: 0,
  },
  getters: {
    getNum(state) {
      return state.num;
    },
  },
  mutations: {
    INCREASE(state, payload) {
      state.num = state.num + payload;
    },
    DECREADE(state, payload) {
      state.num = state.num - payload;
    },
  },
  actions: {
    INCREASE({ commit }, payload) {
      commit("INCREASE", payload);
    },
    DECREADE({ commit }, payload) {
      commit("DECREADE", payload);
    },
  },
});

export default store;
